<%--
    Document   : usuarioExternoCracha
    Created on : 30/03/2013, 00:43:13
    Author     : Max
    Description: Esse documento JSP é utilizado para mostrar o cracha
                 do participante do CIPEM.
--%>
<%@page import="java.util.logging.Logger"%>
<%@page import="java.util.logging.Level"%>
<%@page import="net.sourceforge.barbecue.BarcodeException"%>
<%@page import="Util.BarraHandler"%>
<%@page import="Model.Usuario" %>
<%@page import="Model.UsuarioExterno" %>
<%@page import="Util.UtilUsuario" %>
<%
    UsuarioExterno usuarioExterno = (UsuarioExterno) session.getAttribute("user");
    if (usuarioExterno == null) {
        response.sendRedirect("/pet/cipem");
    } else {
%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>VI CIPEM - Ciclo de Palestras Empreendedoras de Maringá</title>
        <link href='css/stylescipemcracha.css' rel='stylesheet' type='text/css' media="screen, print">
    </head>
    <body>
        <div class="cracha">
            <div>
                <img src="css/images/logoCipem.svg" alt="CIPEM Logo"/>
            </div>
            <h1><%= usuarioExterno.getNome()%></h1>
            <p>
                <strong>CPF: </strong><%= usuarioExterno.getCpf()%><br/>
                <strong>RG: </strong><%= usuarioExterno.getRg()%>
            </p>
            <div id="bcTarget"></div>
        </div>
        <script src="js/jquery-1.9.1.min.js" type="text/javascript"></script>
        <script src="js/jquery-barcode.js" type="text/javascript"></script>
        <script type="text/javascript">
            <%
                String cpf = usuarioExterno.getCpf();
                cpf = cpf.replace(".", "");
                cpf = cpf.replace("-", "");
            %>
                var s = "<%=cpf%>";
                $("#bcTarget").barcode(s, "code128",{barWidth:1, barHeight:50,showHRI:false});
                window.print();
        </script>
    </body>
</html>
<%
    }
%>
